<template>
  <div class="aside-lst" :class="{'active':active}">
    <span class="truncat"><slot/></span>
        
    <el-button text type="primary" size="small" class="ml-auto px-1" @click.stop="$emit('edit')">
      <el-icon :size="12"><Edit /></el-icon>
    </el-button>
    <span @click.stop="()=>{}">
      <el-popconfirm title="是否要删除?" confirm-button-text="确认" cancel-button-text="取消" @confirm="$emit('delete')">
        <template #reference>
          <el-button text type="primary" size="small">
            <el-icon :size="12"><Close /></el-icon>
          </el-button>
        </template>
      </el-popconfirm>
    </span>
   
    
  </div>  
</template>

<script setup>
defineProps({
  active:{
    type:Boolean,
    default:false
  }
})

defineEmits(["edit","delete"])
</script>

<style lang='scss'>
.aside-lst {
  border-bottom: 1px solid #f4f4f4;
  @apply flex items-center p-3 text-sm text-gray-600;
  cursor: pointer;
}
.aside-lst:hover,.active {
  @apply bg-blue-50;
}
</style>